2 // AIVideoChatWindowController.m
5 // Created by Adam Iser on 12/4/04.
6 // Copyright 2004 __MyCompanyName__. All rights reserved.
9 #import "AIVideoChatWindowController.h"
11 #define VIDEO_CHAT_NIB @"VideoChat"
13 @implementation AIVideoChatWindowController
15 + (id)windowForVideoChat:(AIVideoChat *)inVideoChat
17 return [[[self alloc] initWithWindowNibName:VIDEO_CHAT_NIB videoChat:inVideoChat] autorelease];
20 - (id)initWithWindowNibName:(NSString *)windowNibName videoChat:(AIVideoChat *)inVideoChat
22 [super initWithWindowNibName:windowNibName];
24 videoChat = [inVideoChat retain];
26 //Observe frames for this video chat
27 [[adium videoChatController] registerVideoChatObserver:self];
32 //Setup the window before it is displayed
35 NSWindow *window = [self window];
36 NSRect frame = [window frame];
38 [window setAspectRatio:NSMakeSize(frame.size.width, frame.size.height)];
41 - (BOOL)windowShouldClose:(id)sender
43 [[adium videoChatController] unregisterVideoChatObserver:self];
50 - (void)videoChatFrameChanged:(AIVideoChat *)inVideoChat
52 [videoImageView setImage:[videoChat remoteFrame]];